{% extends 'layout/base.html' %}
{% block title %} 文章列表 {% endblock%}


{% block main %}

<h1 class="">文章列表</h1>
<div class="row justify-content-center">
    
    <div class="col-md-8">
        {% for post in posts %}
        <div class="media border" style="margin-top: 10px;">
            <a href="{{url_for('main.user_article_page', uid=post.user_id, aid=post.id)}}">
                <img style="width: 100px;" src="{{ post.cover_url }}" class="mr-3" alt="cover_url"></a>
            <div class="media-body" style="word-break:break-all;">
                <div>
                    <h5 class="mt-0"><a style="color: black;" href="{{url_for('main.user_article_page', uid=post.user_id, aid=post.id)}}">{{post.title}}</a></h5>
                     | <span><a href="{{ url_for('main.user_page', uid=post.user_id) }}">{{post.author.username}}</a></span> | 
                    <span style="color:#898989">{{ post.created_time }}</span>
                </div>
                <p>{{post.abstract}}</p>
                <div style="font-size: x-small;">
                    {% for t in post.tags.all() %}
                    <span> {{t.name}} </span>
                    {% endfor %}
                </div>
            </div>
        </div>
        {% endfor %}
        <div>
            {% from 'layout/next_page.html' import page_nav %}
                {{page_nav(pages, page, "main.articles")}}
        </div>
    </div>
</div>



{% endblock%}